import {roleList} from '../../../request/api'
const state = {
    rolelist:[]
}
const getters = {
    getRoleList(state){
        return state.rolelist
    }
}
const mutations = {
    REQ_ROLELIST(state,payload){
        state.rolelist = payload
    }
}
const actions = {
    changeRoleAction({commit}){
        roleList().then((res)=>{
            if(res.data.code==200){
                let list = res.data.list ? res.data.list : [];
                commit('REQ_ROLELIST',list)
            }
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    // 开启命名空间
    namespaced:true,
};